<?php
!defined('M_COM') && exit('No Permission');
global $mspacedir,$mspacepmid;
$query = $db->query("SELECT * FROM {$tblprefix}members WHERE mspacepath<>''");
$mids = $dirs = array();
while($r = $db->fetch_array($query)){
	if(empty($mspacepmid) || !mem_permission($r,'other',$mspacepmid)){
		$mids[] = $r['mid'];
		$dirs[] = $r['mspacepath'];
	}
}
$mids && $db->query("UPDATE {$tblprefix}members SET mspacepath='',msrefreshdate=0 WHERE mid".multi_str($mids));
foreach($dirs as $v) clear_dir(M_ROOT."$mspacedir/$v",true);
?>